package com.zhc.tools.core.fileimport.domain;

import java.util.HashMap;
import java.util.Map;

/**
 * 导入结果状态枚举
 * @author zhc
 */
public enum ImportFileResultEnum {

	SUCCESS(200, "成功"),
	NOT_FOUND_FILENAME_ERROR(401, "文件名为空！"),
	NOT_STANDARD_FILENAME_ERROR(402, "导入文件名称不合规范"),
	NOT_FOUND_TYPE_ERROR(404, "无此导入类别！"),
	NO_PERMISSION_ERROR(405, "您无权限操作，请登录！"),
	TITLE_ERROR(301, "导入第一列标题不合规范"),
	FILE_PARAM_ERROR(302, "文件数据异常"),
	MATCH_PARAM_ERROR(303, "匹配数据异常"),
	CONV_PARAM_ERROR(304, "转换数据异常"),
	BUSINESS_PARAM_ERROR(501, "其他业务数据异常"),
	REPEAT_PARAM_ERROR(502, "插入数据库重复"),
	DATA_EMPTY_ERROR(503, "待处理数据为空"),
	BUSINESS_ERROR(500, "操作异常");

	int status;
	
	String message;
	
	ImportFileResultEnum(int status, String message) {
		this.status = status;
		this.message = message;
	}
	
	public static Map<Integer, String> getKeyMaps(){
		Map<Integer, String> dataMap = new HashMap<Integer, String>();
		for (ImportFileResultEnum enumObj : ImportFileResultEnum.values()) {
			dataMap.put(enumObj.getStatus(), enumObj.getMessage());
		}
		return dataMap;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}
